{extend name='public/modal'}
{block name='content'}
<style type="text/css">
    .submit_btn{
         float: center;
  }
</style>
<form action="add_user" class="layui-form layui-form-pane" id="mainForm" method="post">

    <form class="form-horizontal" id='addForm' action="addUser">

        <div class="layui-form-item">
            <label class="layui-form-label">
              图片（注:需要修改请先删除）
            </label>
            <div class="layui-input-block" id="addfile">
              <a><div onclick="addfile()" class="picadd">添加图片</div> </a>
              <div id="single_thelist" class="uploader-list"></div>
              <div style="clear: both;"></div>
            </div>
          </div>
        
          <!-- 图片管理s -->
          <input type="hidden"  id="single_imgurl" value="" hidden="">
        
          <input type="hidden"  id="single_imgurls" value="" hidden="">
        
          <!-- 最终提交的名字 -->
          <input type="hidden" name="file_id" id="single_parentIframe" value="" hidden="">
        
          <input type="hidden"  id="single_parentIframe1" value="" hidden="">
        
          <input type="hidden" id="dshow" value="" hidden="">
          <!-- 图片管理e -->
        
          <div class="layui-form-item">
            <label class="layui-form-label">
              图集
            </label>
            <div class="layui-input-block">
             <a><div onclick="addfiles()" class="picadd">添加图片</div> </a>
             <!-- <div id="new" class="picadd">图片管理</div> -->
        
             <div id="thelist" class="uploader-list"></div>
             <div style="clear: both;"></div>
        
           </div>
         </div>
        
         <!-- 图片管理s -->
         <input type="hidden"  id="imgurl" value="" hidden>
        
         <input type="hidden"  id="imgurls" value="" hidden>
        
         <!-- 最终提交的名字 -->
         <input type="hidden" name="files" id="parentIframe" value="" hidden>
        
         <input type="hidden"  id="parentIframe1" value="" hidden>
        
         <!-- <input type="text" id="dshow" value="radioshow"> -->
        
         <!-- 图片管理e --> 




                       <div class="layui-form-item">
                            <label class="layui-form-label">
                                角色
                            </label>
                            <div class="layui-input-block">
                                   <select id="group_id" name="group_id" class="form-control">
                                    <option value="">请选择用户组1</option>
                                    {volist name='role' id='vo'}
                                        <option value="{$vo.id}">{$vo.title}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>




                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                用户名
                            </label>
                            <div class="layui-input-block">
                                 <input type="username" name="username"  class="layui-input" id="username" placeholder="用户名">
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                密码
                            </label>
                            <div class="layui-input-block">
                                  <input type="password" name="password" class="layui-input" id="password" placeholder="请输入密码">
                            </div>
                        </div>


                         <div class="layui-form-item">
                            <label class="layui-form-label">
                                确认
                            </label>
                            <div class="layui-input-block">
                                  <input type="password" name="check_password" class="layui-input" id="check_password" placeholder="确认密码">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                手机号码
                            </label>
                            <div class="layui-input-block">
                                  <input type="text" name="mobile" class="layui-input" id="mobile" placeholder="请输入手机号码">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                邮箱
                            </label>
                            <div class="layui-input-block">
                                  <input type="email" name="email" class="layui-input" id="email" placeholder="请输入电子邮箱">
                            </div>
                        </div>

                </div>

            <div class="layui-form-item">
                <div class="layui-input-block submit_btn">
                    <input id="addReset" type="reset" style="display: none" value="这个是Form清除" />
                    <button type="submit" class="layui-btn layui-btn-success">保存</button>
                </div>
            </div>
</form>
{/block}
{block name='js'}

<script type="text/javascript" src="__common__/js/piccheckbox.js"></script>

<script type="text/javascript">

    //单图添加
    function addfile() {
      var b = $('#single_parentIframe').val();
      if(b){
        b= b.split(','); 
        console.log(b.length);
        layer.msg('请先删除再添加，只能选单张喔！');
      }else{
        lotus_show('图片管理器','{:url('admin/Picmanagement/showAddfilelist')}',0,0);
        $("#dshow").val('1');
      }
    }

    //多图添加
    function addfiles(){
      $("#dshow").val('');
      lotus_show('图片管理器','{:url('admin/Picmanagement/showAddfilelist')}',0,0)
    }

  </script>

  
<script type="text/javascript">
    $(function(){
        var options = {
              type:'post',           //post提交
              //url:'http://ask.tongzhuo100.com/server/****.php?='+Math.random(),   //url
              dataType:"json",        //json格式
              data:{},    //如果需要提交附加参数，视情况添加
              clearForm: false,        //成功提交后，清除所有表单元素的值
              resetForm: false,        //成功提交后，重置所有表单元素的值
              cache:false,
              async:false,          //同步返回
              success:function(data){
                    if(data.code==0){
                      layer.msg(data.msg);
                    }else{
                      layer.msg(data.msg,{icon:1,time:500},function(){
                        $("#reset").click();
                        lotus_close();
                        parent.location.reload();
                      });
                    }
                  //服务器端返回处理逻辑
                },
                error:function(XmlHttpRequest,textStatus,errorThrown){
                  layer.msg('操作失败:服务器处理失败');
              }
            };
          layui.use('form', function(){
            var form = layui.form;
            $('#mainForm').ajaxForm(options).submit(function(data){});
          });

        })
      // });
</script>
{/block}
